Skip to content

Workflow Dispatch Command Injection Fix #24864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2025

Conversation

Toritos01
Copy link
Contributor

Description

This fix sets GitHub context variables (github.event.inputs.*) as env directives instead of directly sticking them into a command. Doing this ensures that potential shell characters are properly escaped, mitigating the risk of command injection attacks.

@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 18:38
@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels Jun 17, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR mitigates potential command injection vulnerabilities by changing the way GitHub context inputs are passed into commands.

  • Uses environment variables to safely supply the input values instead of inline interpolation.
  • Refactors both the PR number and tag input retrieval in the workflow files.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/release-approval.yml Refactored PR input handling using an env block to safely reference the input in the echo step.
.github/workflows/push-tag-create-release.yml Refactored tag input handling via env blocks in multiple steps to avoid direct interpolation.

@Toritos01 Toritos01 merged commit e358efc into microsoft:main Jun 17, 2025
29 checks passed
@Toritos01 Toritos01 deleted the bdiaz/workflowInjectionFix branch June 17, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants